# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=properties-cpp
pkgver=0.0.2
pkgrel=0
pkgdesc="A very simple convenience library for handling properties and signals in C++11"
url="https://gitlab.com/ubports/core/lib-cpp/properties-cpp"
arch="noarch"
license="LGPL-3.0-only"
makedepends="cmake gtest-dev"
subpackages="$pkgname-dev"
source="https://gitlab.com/ubports/core/lib-cpp/properties-cpp/-/archive/$pkgver/properties-cpp-$pkgver.tar.gz
	0001-CMake-cleanup.patch"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="7ec94ce495c9630d5acc0b98051b31e7eb3e50fef9dff3a476cd91ca912937f48826fbdab57907b042b13e29786dcb3483151690374b0e09d6e1c12c6329df5a  properties-cpp-0.0.2.tar.gz
ce6a258c5c57e41e2b1cbc7e2988f8b89d61c36415cc03986e33511a1fb09b793fb473aa5f8da6d80c906454a4152c096ffdfb32570a83a8ae2bdfc888a25248  0001-CMake-cleanup.patch"
